/*
 * @Date: 2024-12-18 10:46:56
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2024-12-18 10:53:30
 * @Description: 函数式调用组件相关服务
 */
import { callComp } from './CallCompPlugins.jsx'
import { ElMessage } from 'element-plus'

// 操作日志
import { OperationLog } from '@/components/drawer';


/**
 * 打开操作日志Drawer
 * @param {Array} rows 选中的行
 * @param {String} key 选中的行的对象id的key
 */
export function openOperationLogs (rows, key='applyId') {
  if (rows.length !== 1) {
    ElMessage.warning('请选择一条数据进行操作！')
    return
  }
  const objectId = rows[0][key]
  callComp.open(OperationLog, {
    className: 'operation-log-warpper',
    params: {
      objectId: objectId
    }
  })
}